Skip to content

Generate pig-latin's test suite from the canonical data - #940

Merged
rabestro merged 2 commits into
mainfrom
pig-latin-generated-tests
Nov 13, 2026
Merged

rabestro merged 2 commits into
mainfrom
pig-latin-generated-tests

Conversation

@rabestro

@rabestro rabestro commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Sync tests.toml with problem-specifications and generate the suite from a new .meta/template.j2.

  • Added "word beginning with consonant and vowel containing qu" (liquid).
  • "a whole phrase" is replaced by its latest reimplementation, why do squids enjoy xrays → ywhay oday idssquay enjoyay xraysay, which mixes words that start with vowels and with consonants. The original case and the intermediate one (with the xrayay typo) are excluded with a "Reimplemented by" comment. The suite has 23 cases (it had 22).
  • The old example failed the new phrase case: once a phrase had a word starting with a vowel, it left the other words untranslated. It is rewritten in Scala 3 with a regex per word. The stub, which was empty, now declares def translate(phrase: String): String.
  • The approach (Dig deeper) is written in Scala 3 syntax: braceless, if ... then, @tailrec imported, vowelsY instead of vowels_y, and the lambda passed to map after a colon. API links point at the current Scaladoc, and a few typos are fixed. Slug and uuid are unchanged.

The tests change, so solutions will be re-run, and solutions with the same bug as the old example will now fail the phrase case. The approach's code from main passes the new suite, and so does the new code.

Part of #488, #843 and #914.

🤖 Generated with Claude Code

Sync tests.toml with problem-specifications, then generate the suite
from a new .meta/template.j2. It adds the "liquid" case, and the whole
phrase case is replaced by its reimplementation, which mixes words that
start with vowels and with consonants.

The old example translated only one kind of word in a phrase, so it is
rewritten in Scala 3 with a regex per word. The stub and the approach
are written in Scala 3 syntax too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rabestro rabestro self-assigned this Nov 13, 2026
@rabestro
rabestro requested review from a team, IsaacG and glennj November 13, 2026 12:11
@github-actions

Copy link
Copy Markdown

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@github-actions

Copy link
Copy Markdown

Hello 👋 Thanks for your PR.

This repo does not currently have dedicated maintainers. Our cross-track maintainers team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed.

If you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track.

Please feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the Exercism forum.

(cc @exercism/cross-track-maintainers)

@rabestro
rabestro requested a review from a team November 13, 2026 12:12
[no important files changed]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rabestro
rabestro merged commit bc2a7fc into main Nov 13, 2026
8 checks passed
@rabestro
rabestro deleted the pig-latin-generated-tests branch November 13, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants